<switch name="Think.get.handle">
	<case value="insert">
<form name="form1" method="post" action="__URL__/common?type_link=data&handle=insert">
<table width="750" border="1" cellspacing="1" cellpadding="1">
  <tr>
    <td colspan="2" align="center">数据添加</td>
  </tr>
  <tr>
    <td width="178" align="right">类别选择</td>
    <td width="559" align="left" >
     <select name="middleid" id="middleid" >
       <option selected="selected">请选择</option>
      <foreach name="data2" item="result2" >
		<option value="{$result2.id}">{$result2.ChineseName}</option>
    </foreach>
    </select>
     <select name="elementaryid" id="elementaryid" >
       <option selected="selected">请选择</option>
      <foreach name="data3" item="result3" >
		<option value="{$result3.id}">{$result3.ChineseName}</option>
    </foreach>
    </select>
     <select name="smallid" id="smallid" >
     <option selected="selected">请选择</option>
     <foreach name="data4" item="result4" >
		<option value="{$result4.id}">{$result4.ChineseName}</option>
    </foreach>
    </select>*请选择其中一项类别
	</td>
  </tr>
  <tr>
    <td align="right">名称</td>
    <td align="left"><input name="title" type="text" id="title" size="40"></td>
  </tr>
   <tr>
    <td align="right">链接地址</td>
    <td align="left"><input name="href" type="text" id="href" size="40"></td>
  </tr>
  <tr>
    <td align="center">&nbsp;</td>
    <td><input type="submit" name="button" id="button" value="提交">
      &nbsp;&nbsp;&nbsp;&nbsp;
      <input type="reset" name="button2" id="button2" value="重置"></td>
  </tr>
</table>
</form>
    </case>
	<case value="admin">
       <table width="750" border="1" cellspacing="1" cellpadding="1">
        <tr>
          <td>ID</td>
          <td>名称</td>
          <td>链接地址</td>
          <td>所属类别</td>
          <td>操作</td>
        </tr>
        <foreach name="list" item="result" >
       <tr>
          <td>{$result.id}</td>
          <td>{$result.title}</td>
          <td>{$result.href}</td>
          <td>
          <if condition="($result.middleid neq 0 ) and ($result.elementaryid neq 0) and ($result.smallid neq 0 )">
          	中级类别/初级类别/子类别
		  <elseif condition="($result.middleid neq 0 ) and ($result.elementaryid neq 0)" />
		          中级类别/初级类别
		  <elseif condition="($result.elementaryid neq 0) and ($result.smallid neq 0)" />
		         初级类别/子类别
		  <elseif condition="($result.middleid neq 0 ) and ($result.smallid neq 0)" />
		          中级类别/子类别    
		  <elseif condition="$result.middleid neq 0 " />
		          中级类别
		 <elseif condition="$result.elementaryid neq 0 " />
		          初级类别
		  <else />
		          子类别
          </if>
          </td>
          <td><a href="__URL__/deletedata?type_link=data&handle=admin&link_id={$result.id}">删除</a></td>
        </tr>
        </foreach>
        <tr>
          <td colspan="5">{$page}</td>
        </tr>
      </table>
	</case>
	<default  />
    	  <table width="750" border="1" cellspacing="1" cellpadding="1">
        <tr>
          <td>ID</td>
          <td>名称</td>
          <td>链接地址</td>
          <td>所属类别</td>
          <td>操作</td>
        </tr>
        <foreach name="list" item="result" >
       <tr>
          <td>{$result.id}</td>
          <td>{$result.title}</td>
          <td>{$result.href}</td>
          <td>
          <if condition="($result.middleid neq 0 ) and ($result.elementaryid neq 0) and ($result.smallid neq 0 )">
          	中级类别/初级类别/子类别
		  <elseif condition="($result.middleid neq 0 ) and ($result.elementaryid neq 0)" />
		          中级类别/初级类别
		  <elseif condition="$result.middleid neq 0 " />
		          中级类别
		  
		  <else />
		          子类别
          </if>
          </td>
          <td><a href="__URL__/deletedata?type_link=data&handle=admin&link_id={$result.id}">删除</a></td>
        </tr>
        </foreach>
        <tr>
          <td colspan="5">{$page}</td>
        </tr>
      </table>
</switch>

